package com.smt.ejb3.tutoria.client;

import javax.naming.InitialContext;
import javax.naming.NamingException;

import com.smt.ejb3.tutoria.entitybean.compositekey.AirLine;
import com.smt.ejb3.tutoria.entitybean.compositekey.AirLineManager;
import com.smt.ejb3.tutoria.entitybean.compositekey.AirLinePK;

public class AirLineClient {
	public static void main(String[] args) {
		try {
			InitialContext ctx = new InitialContext();

			AirLineManager service = (AirLineManager) ctx
					.lookup("AirLineManagerBean/remote");
			AirLinePK pk = new AirLinePK();
			pk.setStartCity("CAN");
			pk.setEndCity("SHA");
			AirLine a = new AirLine();
			a.setPk(pk);
			a.setName("Air");
			service.saveAirLine(a);
			

		} catch (NamingException ex) {
			ex.printStackTrace();
		}
	}
}
